1. Field of the Invention
The present invention generally relates to computer systems, particularly to the handling of device requests, and more particularly to a method and system which handle these requests through adaptive polling in a way that maintains performance and responsiveness while conserving power consumption.
2. Description of the Related Art
A generalized client-server computing network 2 is shown in FIG. 1. Network 2 has several servers 4, 6, 8 and 9, which are interconnected, either directly to each other or indirectly through one of the other servers. Each server is essentially a stand-alone computer system (having one or more processors, memory devices, and communications devices), but has been adapted (programmed) for one primary purpose, that of providing information to individual users at workstation clients 10. Clients 10 can also be stand-alone computer systems (like personal computers, or PCs), or “dumber” systems adapted for limited use with network 2 (like network computers, or NCs). As used herein, “PC” generally refers to any multi-purpose computer adapted for use by a single individual, regardless of the manufacturer, hardware platform, operating system, etc. A single, physical computer can act as both a server and a client, although this implementation occurs infrequently.
The information provided by a server can be in the form of programs that run locally on a given client 10, or in the form of data such as files used by other programs. Users can also communicate with each other in real-time as well as by delayed file delivery, i.e., users connected to the same server can all communicate with each other without the need for the network 2, and users at different servers, such as servers 4 and 6, can communicate with each other via network 2. The network can be local in nature (i.e., a LAN), or can be further connected to other systems (not shown) as indicated with servers 8 and 9. The construction of network 2 is also generally applicable to the Internet.
Traditionally, general-purpose systems have been characterized by their performance. Roughly, a given system is evaluated based on the rate at which it handles specific operations. Examples include transactions-per-second, Web request-per second, and the like. Recently, power consumption has gained importance due to commercial, national and environmental concerns. It is estimated that computing systems consume about one tenth of the power generated in North America. Therefore, there is an increasing demand for power-efficient computing systems that do not compromise performance.
A general-purpose computer system (client, server or dumb device) comprises a processor, main memory and a number of devices. Several buses typically connect these components according to some well-known protocol. An example of such protocols is the Peripheral Component Interconnect (PCI). On typical general-purpose computer systems a processor handles each peripheral device request as a result of an interrupt, which originates at a device. Upon each interrupt, a context switch occurs in the processor, during which the processor state is saved to main memory and a new state is initialized to process the device request. Each such context switch incurs an excessive overhead due to the state transfers and the destructive effects on various memory caches and the resulting perturbation to the locality of memory references. Modern processors in particular have become more sensitive to this kind of overhead because of the growing gap between the processor speed and the memory access time. It is therefore detrimental to performance if a high-rate of interrupts is generated from the system devices.
Polling is an alternative method to interrupts by which the processor (CPU) may process device requests. A CPU may, for example, poll a network device to determine if there are any packets to be processed. Network appliances, including software-based switches, firewalls, proxy servers, and even first-tier web servers are increasingly making use of polled input/output (I/O) to actively coalesce interrupts, and increase overall system performance by reducing the latencies involved with context switching during interrupt handling. Polling is inefficient due to the unnecessary and continuous checking of device status when the rate of device activities such as network traffic is not relatively high. Additionally, polling is detrimental to power consumption since it occurs constantly, whether there is work to do or not, preventing the system from ever entering a “sleep” state where appropriate instructions can be issued to conserve power spent by the CPU. Thus, polling can invalidate the most fundamental power conservation strategies.
In light of the foregoing, it would be desirable to devise an improved method for managing device service requests which increases the overall system performance and responsiveness, while conserving power and enabling sophisticated power management mechanisms.